package org.tao.lightningmq.common.dto;

import java.util.Arrays;

/**
 * @Author lht
 * @date 2025/1/5 - 11:02
 * @description:
 */
public class ConsumeMsgCommitLogDTO {

    private String fileName;

    private long commitLogOffset;

    private int commitLogSize;

    private byte[] body;

    private int retryTimes;
    /**
     * 这条消息在ConsumeQueue中的偏移量，用于避免重复确认。
     */
    private int MsgConsumeQueueOffset;

    public String getFileName() {
        return fileName;
    }

    public void setFileName(String fileName) {
        this.fileName = fileName;
    }

    public long getCommitLogOffset() {
        return commitLogOffset;
    }

    public void setCommitLogOffset(long commitLogOffset) {
        this.commitLogOffset = commitLogOffset;
    }

    public int getCommitLogSize() {
        return commitLogSize;
    }

    public void setCommitLogSize(int commitLogSize) {
        this.commitLogSize = commitLogSize;
    }

    public byte[] getBody() {
        return body;
    }

    public void setBody(byte[] body) {
        this.body = body;
    }

    public int getRetryTimes() {
        return retryTimes;
    }

    public void setRetryTimes(int retryTimes) {
        this.retryTimes = retryTimes;
    }

    public int getMsgConsumeQueueOffset() {
        return MsgConsumeQueueOffset;
    }

    public void setMsgConsumeQueueOffset(int msgConsumeQueueOffset) {
        MsgConsumeQueueOffset = msgConsumeQueueOffset;
    }

    @Override
    public String toString() {
        return "ConsumeMsgCommitLogDTO{" +
                "fileName='" + fileName + '\'' +
                ", commitLogOffset=" + commitLogOffset +
                ", commitLogSize=" + commitLogSize +
                ", body=" + Arrays.toString(body) +
                ", retryTimes=" + retryTimes +
                '}';
    }
}
